// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
const DRAGGING_WINDOW_OPACITY = 100;
-const BUTTON_LAYOUT_SCHEMA = 'org.gnome.shell.overrides';
-const BUTTON_LAYOUT_KEY = 'button-layout';
-
// When calculating a layout, we calculate the scale of windows and the percent
// of the available area the new layout uses. If the values for the new layout,
// when weighted with the values as below, are worse than the previous layout's,
this._parentActor = parentActor;
this._hidden = false;
- this._settings = new Gio.Settings({ schema: BUTTON_LAYOUT_SCHEMA });
-
this.borderSize = 0;
this.border = new St.Bin({ style_class: 'window-clone-border' });
let button = this.closeButton;
let title = this.title;
- let layout = this._settings.get_string(BUTTON_LAYOUT_KEY);
- let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL;
-
- let split = layout.split(":");
- let side;
- if (split[0].indexOf("close") > -1)
- side = rtl ? St.Side.RIGHT : St.Side.LEFT;
- else
- side = rtl ? St.Side.LEFT : St.Side.RIGHT;
+ let layout = Meta.prefs_get_button_layout();
+ let side = layout.left_buttons.indexOf(Meta.ButtonFunction.CLOSE) > -1 ? St.Side.LEFT : St.Side.RIGHT;
let buttonX;
let buttonY = cloneY - (button.height - button._overlap);